package com.liy.framework.common.extvo;

import java.io.Serializable;

public class ResponseVo implements Serializable {
    private static final long serialVersionUID = -2060002093487337955L;
    private String status = "200";
    private String message = "Success";
    private String code = "";
    private Object data;

    private ResponseVo() {
    }

    public static ResponseVo error(String errorMsg) {
        return error("99", errorMsg);
    }

    public static ResponseVo error(String code, String errorMsg) {
        ResponseVo response = new ResponseVo();
        response.status = "500";
        response.message = errorMsg;
        response.code = code;
        return response;
    }

    public static ResponseVo success() {
        return new ResponseVo();
    }

    public static ResponseVo success(Object obj) {
        return success("00", obj);
    }

    public static ResponseVo success(String code, Object obj) {
        ResponseVo response = new ResponseVo();
        response.status = "200";
        response.code = code;
        response.data = obj;
        return response;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Object getData() {
        return this.data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
